
#include "Number.h"
#include "Subject.h"
#include "Observer.h"

Observer::Observer(void)
{
}

Observer::~Observer(void)
{
}

////////////////////////////////////////////////////

BigLetterObserver::BigLetterObserver(Number* subject, BigLetter* bigLetter)
{
	m_subject = subject;
	m_bigLetter = bigLetter;
}

BigLetterObserver::~BigLetterObserver()
{
}

void BigLetterObserver::update(Subject* subject)
{
	if (m_subject == subject)
	{
		// update the backup data in the display class
		m_bigLetter->set(m_subject->get());
		m_bigLetter->show();
	}
}

////////////////////////////////////////////////////

SmallLetterObserver::SmallLetterObserver(Number* subject, SmallLetter* smallLetter)
{
	m_subject = subject;
	m_smallLetter = smallLetter;
}

SmallLetterObserver::~SmallLetterObserver()
{
}

void SmallLetterObserver::update(Subject* subject)
{
	if (m_subject == subject)
	{
		m_smallLetter->set(m_subject->get());
		m_smallLetter->show();
	}
}
